home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 23
/
AMIGAplus Sonderheft 23 (2000)(Falke)(DE)[!].iso
/
Updates
/
Librarys
/
zee_ini_library
/
Sources
/
C
/
INI_Example
/
INI_Example.s
< prev
next >
Wrap
Text File
|
1999-08-06
|
29KB
|
1,089 lines
; Storm C Compiler
; Work:Sources/C/INI_Example/INI_Example.c
XREF _memcpy
XREF _exit
XREF _std__in
XREF _std__out
XREF _std__err
XREF _SysBase
SECTION ":0",CODE
XDEF _INIT_8_INI_Example_c
_INIT_8_INI_Example_c
L41 EQU 0
link a5,#L41
L40
;0x6f, 0x6e, 0x2e,
;struct ScreenList WBScreen =
lea _WBScreen(a4),a0
add.w #$C,a0
lea _WBScreen(a4),a1
lea $10(a1),a1
move.l a1,(a0)
lea _WBScreen(a4),a1
lea $C(a1),a1
move.l a1,$8(a0)
;struct INIScreen Screens =
lea _Screens(a4),a0
lea _WBScreen(a4),a1
move.l a1,(a0)
lea _WBScreen(a4),a1
move.l a1,$8(a0)
;UWORD DefaultColTab[256] =
lea _DefaultColTab(a4),a0
lea $20(a0),a0
move.w #$1DF,d0
L42
clr.b (a0)+
dbra d0,L42
;struct NewScreen NewScreenStr =
; /* Copy all 256 default colors to updated color t
;unsigned char ScreenContext[16] = "Screen";
;unsigned char WindowContext[16] = "Window";
unlk a5
rts
;void InitNode (struct List *NodeList)
XDEF InitNode__P04List
InitNode__P04List
L44 EQU 0
link a5,#L44
move.l $8(a5),a0
L43
; NodeList->lh_Head = (struct Node *) &(NodeList->lh_Tail);
lea 4(a0),a1
move.l a1,(a0)
; NodeList->lh_Tail = (struct Node *) NULL;
clr.l 4(a0)
; NodeList->lh_TailPred = (struct Node *) &(NodeList->lh_Head);
move.l a0,$8(a0)
unlk a5
rts
;int ReadINIScreens (struct iniFile *iniFile)
XDEF ReadINIScreens__P07iniFile
ReadINIScreens__P07iniFile
L67 EQU -$218
link a5,#L67
movem.l d2-d5/a2/a3/a6,-(a7)
L54
; int rc = 20;
moveq #$14,d5
; unsigned long CurrentScrNum = 1;
moveq #1,d4
; for (;;
L55
;
; iniIntToStr ( ScreenContext+6, CurrentScrNum, INI_FORMAT_DEC
lea _ScreenContext(a4),a0
move.l _INIBase(a4),a6
move.l d4,d0
moveq #0,d1
moveq #0,d2
moveq #$20,d3
lea 6(a0),a0
jsr -$1AA(a6)
; CurrentScrNum++;
addq.l #1,d4
; if (!(CurrentContext = iniFindContext ( iniFile, ScreenConte
move.l _INIBase(a4),a6
moveq #0,d0
move.l $8(a5),a0
lea _ScreenContext(a4),a1
jsr -$1BC(a6)
tst.l d0
bne.b L57
L56
;
; rc = 0;
moveq #0,d5
;
bra L66
L57
; NewScreenStr.LeftEdge = iniReadLong ( iniFile, ScreenContext
move.l _INIBase(a4),a6
moveq #0,d0
moveq #0,d1
move.l $8(a5),a0
lea _ScreenContext(a4),a1
lea L45(pc),a2
jsr -$B4(a6)
move.w d0,_NewScreenStr(a4)
; NewScreenStr.TopEdge = iniReadLong ( iniFile, ScreenContext,
move.l _INIBase(a4),a6
moveq #0,d0
moveq #0,d1
move.l $8(a5),a0
lea _ScreenContext(a4),a1
lea L46(pc),a2
jsr -$B4(a6)
move.w d0,_NewScreenStr+2(a4)
; NewScreenStr.Width = iniReadLong ( iniFile, ScreenContext,
move.l _INIBase(a4),a6
move.l #$280,d0
moveq #0,d1
move.l $8(a5),a0
lea _ScreenContext(a4),a1
lea L47(pc),a2
jsr -$B4(a6)
move.w d0,_NewScreenStr+4(a4)
; NewScreenStr.Height = iniReadLong ( iniFile, ScreenContext,
move.l _INIBase(a4),a6
move.l #$100,d0
moveq #0,d1
move.l $8(a5),a0
lea _ScreenContext(a4),a1
lea L48(pc),a2
jsr -$B4(a6)
move.w d0,_NewScreenStr+6(a4)
; NewScreenStr.Depth = iniReadLong ( iniFile, ScreenContext,
move.l _INIBase(a4),a6
moveq #4,d0
moveq #0,d1
move.l $8(a5),a0
lea _ScreenContext(a4),a1
lea L49(pc),a2
jsr -$B4(a6)
move.w d0,_NewScreenStr+$8(a4)
; NewScreenStr.ViewModes = iniReadLong ( iniFile, ScreenContex
move.l _INIBase(a4),a6
move.l #$8000,d0
moveq #0,d1
move.l $8(a5),a0
lea _ScreenContext(a4),a1
lea L50(pc),a2
jsr -$B4(a6)
move.w d0,_NewScreenStr+$C(a4)
; NewScreenStr.DefaultTitle = iniReadStr ( iniFile, ScreenCont
move.l _INIBase(a4),a6
moveq #0,d0
move.l $8(a5),a0
lea _ScreenContext(a4),a1
lea L52(pc),a2
lea L51(pc),a3
jsr -$C0(a6)
move.l d0,_NewScreenStr+$14(a4)
; memcpy (ScrColorTable,DefaultColTab,256);
pea $100.w
pea _DefaultColTab(a4)
pea -$210(a5)
bsr _memcpy
add.w #$C,a7
; ScrNumCols = (NewScreenStr.Depth < 8 ? 1L<<NewScreenStr.Dept
move.w _NewScreenStr+$8(a4),d0
cmp.w #$8,d0
bge.b L59
L58
move.w _NewScreenStr+$8(a4),d0
ext.l d0
moveq #1,d2
asl.l d0,d2
bra.b L60
L59
move.l #$100,d2
L60
; iniReadWordA ( iniFile, ScreenContext, "ColorTable", (WORD *)
lea -$210(a5),a6
move.l a6,a3
move.l _INIBase(a4),a6
move.l d2,d0
moveq #0,d1
move.l $8(a5),a0
lea _ScreenContext(a4),a1
lea L53(pc),a2
jsr -$CC(a6)
; if (!(ScrStrBuf = (struct ScreenList *) iniAllocPMem (sizeof
move.l _INIBase(a4),a6
moveq #$18,d0
jsr -$1E(a6)
move.l d0,a2
cmp.w #0,a2
bne.b L62
L61
;
; iniFreeNameStr (NewScreenStr.DefaultTitle);
move.l _NewScreenStr+$14(a4),a0
move.l _INIBase(a4),a6
jsr -$30(a6)
;
bra.b L66
L62
; AddTail ((struct List *) &Screens.iniscr_ScrList, (struct No
move.l _SysBase(a4),a6
lea _Screens(a4),a0
move.l a2,a1
jsr -$F6(a6)
; ScreenStr = OpenScreen (&NewScreenStr);
move.l _IntuitionBase(a4),a6
lea _NewScreenStr(a4),a0
jsr -$C6(a6)
move.l d0,a6
; ScrStrBuf->iniscr_ScreenPtr = ScreenStr;
move.l a2,a0
move.l a6,$8(a0)
; InitNode ((struct List *) &(ScrStrBuf->iniscr_WinList));
pea $C(a2)
bsr InitNode__P04List
addq.w #4,a7
; if (ScreenStr == NULL)
cmp.w #0,a6
bne.b L64
L63
;
; iniFreeNameStr (NewScreenStr.DefaultTitle);
move.l _NewScreenStr+$14(a4),a0
move.l _INIBase(a4),a6
jsr -$30(a6)
;
bra.b L66
L64
; LoadRGB4 (&ScreenStr->ViewPort, ScrColorTable, ScrNumCols);
lea $2C(a6),a0
move.l _GfxBase(a4),a6
move.l d2,d0
lea -$210(a5),a1
jsr -$C0(a6)
L65
bra L55
L66
move.l d5,d0
movem.l (a7)+,d2-d5/a2/a3/a6
unlk a5
rts
;int ReadINIWindows (struct iniFile *iniFile)
XDEF ReadINIWindows__P07iniFile
ReadINIWindows__P07iniFile
L92 EQU -$20
link a5,#L92
movem.l d2-d5/a2/a3/a6,-(a7)
L76
; int rc = 20;
moveq #$14,d4
; unsigned long CurrentWinNum = 1;
moveq #1,d5
; for (;;
L77
;
; iniIntToStr ( WindowContext+6, CurrentWinNum, INI_FORMAT_DEC
lea _WindowContext(a4),a0
move.l _INIBase(a4),a6
move.l d5,d0
moveq #0,d1
moveq #0,d2
moveq #$20,d3
lea 6(a0),a0
jsr -$1AA(a6)
; CurrentWinNum++;
addq.l #1,d5
; if (!(CurrentContext = iniFindContext ( iniFile, WindowConte
move.l _INIBase(a4),a6
moveq #0,d0
move.l $8(a5),a0
lea _WindowContext(a4),a1
jsr -$1BC(a6)
tst.l d0
bne.b L79
L78
;
; rc = 0;
moveq #0,d4
;
bra L91
L79
; NewWindowStr.LeftEdge = iniReadLong ( iniFile, WindowContext
move.l _INIBase(a4),a6
moveq #0,d0
moveq #0,d1
move.l $8(a5),a0
lea _WindowContext(a4),a1
lea L45(pc),a2
jsr -$B4(a6)
move.w d0,_NewWindowStr(a4)
; NewWindowStr.TopEdge = iniReadLong ( iniFile, WindowContext,
move.l _INIBase(a4),a6
moveq #0,d0
moveq #0,d1
move.l $8(a5),a0
lea _WindowContext(a4),a1
lea L46(pc),a2
jsr -$B4(a6)
move.w d0,_NewWindowStr+2(a4)
; NewWindowStr.Width = iniReadLong ( iniFile, WindowContext,
move.l _INIBase(a4),a6
move.l #$280,d0
moveq #0,d1
move.l $8(a5),a0
lea _WindowContext(a4),a1
lea L47(pc),a2
jsr -$B4(a6)
move.w d0,_NewWindowStr+4(a4)
; NewWindowStr.Height = iniReadLong ( iniFile, WindowContext,
move.l _INIBase(a4),a6
move.l #$100,d0
moveq #0,d1
move.l $8(a5),a0
lea _WindowContext(a4),a1
lea L48(pc),a2
jsr -$B4(a6)
move.w d0,_NewWindowStr+6(a4)
; NewWindowStr.IDCMPFlags = iniReadLong ( iniFile, WindowConte
move.l _INIBase(a4),a6
move.l #$20000,d0
moveq #0,d1
move.l $8(a5),a0
lea _WindowContext(a4),a1
lea L68(pc),a2
jsr -$B4(a6)
move.l d0,_NewWindowStr+$A(a4)
; NewWindowStr.Flags = iniReadLong ( iniFile, WindowContext,
move.l _INIBase(a4),a6
move.l #$100F,d0
moveq #0,d1
move.l $8(a5),a0
lea _WindowContext(a4),a1
lea L69(pc),a2
jsr -$B4(a6)
move.l d0,_NewWindowStr+$E(a4)
; NewWindowStr.Title = iniReadStr ( iniFile, WindowContext,
move.l _INIBase(a4),a6
moveq #0,d0
move.l $8(a5),a0
lea _WindowContext(a4),a1
lea L52(pc),a2
lea L70(pc),a3
jsr -$C0(a6)
move.l d0,_NewWindowStr+$1A(a4)
; NewWindowStr.MinWidth = iniReadLong ( iniFile, WindowContext
move.l _INIBase(a4),a6
moveq #$20,d0
moveq #0,d1
move.l $8(a5),a0
lea _WindowContext(a4),a1
lea L71(pc),a2
jsr -$B4(a6)
move.w d0,_NewWindowStr+$26(a4)
; NewWindowStr.MaxWidth = iniReadLong ( iniFile, WindowContext
move.l _INIBase(a4),a6
move.l #$280,d0
moveq #0,d1
move.l $8(a5),a0
lea _WindowContext(a4),a1
lea L72(pc),a2
jsr -$B4(a6)
move.w d0,_NewWindowStr+$2A(a4)
; NewWindowStr.MinHeight = iniReadLong ( iniFile, WindowContex